package com.gongchang.fangfa;




public class Car4s2 {
    //
    private CarFactory2 carFactory2;

    public void sellcar(){
        //
      carFactory2.getCar();

    }

    public CarFactory2 getCarFactory2() {
        return carFactory2;
    }

    public void setCarFactory2(CarFactory2 carFactory2) {
        this.carFactory2 = carFactory2;
    }

    public static void main(String[] args) {

        Car4s2  car4s2 = new Car4s2();
        car4s2.setCarFactory2(new BenChiFactory());
        car4s2.sellcar();
    }

}
